<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <ul id="wrap">

  </ul>
</body>
</html>

<script>
// 英文： detail - 详情

var arr = [
  {
    name: 'Jack',
    age: 28,
    detail: '你好，我是jack我爱好音乐'
  },
  {
    name: 'Rose',
    age: 20,
    detail: '你好，我是Rose我爱坦坦尼克号'
  },
  {
    name: 'Tom',
    age: 22,
    detail: '你好，我是Tom，我爱好 老鼠与🐱'
  }
];
let wrapUl = document.querySelector('#wrap');

wrapUl.innerHTML = `${
  arr.map(function(item) {
    return `
      <li data-details=${item.detail}>
        <span>姓名：</span>
        <span>${item.name}</span>
      </li>
      <li data-details=${item.detail}>
        <span>年龄：</span>
        <span>${item.age}</span>
      </li>  
    `
  }).join('')
}`;

let lis = document.querySelectorAll('li');
lis.forEach(function(li) {
  li.onclick = function() {
    alert(li.dataset.details);
    console.log(li.dataset.details, '我点击了 li');
  }
})
// console.log(lis);


</script>